The development and distribution of hardware capable of playing and storing high-resolution or high-image quality video content has caused an increase in the necessity of a video codec for effectively encoding or decoding the high-resolution or high-image quality video content. According to the existing video codec, a video is encoded using limited encoding methods based on macroblocks having predetermined sizes.
In inter prediction, motion prediction and compensation are used to compress an image by removing temporal redundancy between pictures. In motion prediction, blocks of a current picture are predicted by using at least one reference picture. A video codec calculates a cost of each prediction mode by using available prediction modes, and determines an optimum prediction mode.